/**
Group: efl/slider/horizontal (@since 1.23)
	 Part Rectangle: efl.draggable.slider
	 Part Swallow: efl.bar
	 Signal: efl,state,disabled
	 Signal: efl,state,enabled
	 Signal: efl,state,inverted,off
	 Signal: efl,state,inverted,on
Group: efl/slider/vertical (@since 1.23)
	 Part Rectangle: efl.draggable.slider
	 Part Swallow: efl.bar
	 Signal: efl,state,disabled
	 Signal: efl,state,enabled
	 Signal: efl,state,inverted,off
	 Signal: efl,state,inverted,on
*/
group { name: "efl/slider/horizontal";
   data.item: "version" "123";
#define INVERT  16
   script {
      public slmode;
      public eval_mode(m) {
         new d = m & DISABLE;
         new i = m & INVERT;
         if (i) {
            if (!d) {
               set_state(PART:"base", "default", 0.0);
               set_state(PART:"glow", "inverted", 0.0);
            } else {
               set_state(PART:"base", "disabled", 0.0);
               set_state(PART:"glow", "disabled_inverted", 0.0);
            }
         } else {
            if (!d) {
               set_state(PART:"base", "default", 0.0);
               set_state(PART:"glow", "default", 0.0);
            } else {
               set_state(PART:"base", "disabled", 0.0);
               set_state(PART:"glow", "disabled", 0.0);
            }
         }
         if (!d) {
            set_state(PART:"event", "default", 0.0);
            set_state(PART:"knob", "default", 0.0);
         } else {
            set_state(PART:"event", "disabled", 0.0);
            set_state(PART:"knob", "disabled", 0.0);
         }
      }
   }
   parts {
      part { name: "efl.bar"; type: SWALLOW;
         scale: 1;
         description { state: "default" 0.0;
            min: 40 20;
            max: 99999 20;
            align: 1.0 0.5;
            rel1.offset: 4 4;
            rel2.offset: -5 -5;
            offscale;
         }
      }
      part { name: "base"; type: RECT; mouse_events: 0;
         scale: 1;
         description { state: "default" 0.0;
            rel.to: "efl.bar";
            color_class: "/bg/normal/slider/base";
            min: 8 4;
            max: 99999 4;
            fixed: 0 1;
         }
         description { state: "disabled" 0.0;
            inherit: "default" 0.0;
            color_class: "/bg/disabled/slider/base";
         }
      }
      part { name: "glow"; type: RECT; mouse_events: 0;
         description { state: "default" 0.0;
            color_class: "/fg/normal/slider/bar";
            rel1.to: "base";
            rel2.relative: 0.5 1.0;
            rel2.to_x: "knob";
            rel2.to_y: "base";
         }
         description { state: "disabled" 0.0;
            inherit: "default" 0.0;
            color_class: "/fg/disabled/slider/bar";
         }
         description { state: "inverted" 0.0;
            color_class: "/fg/normal/slider/bar";
            rel1.relative: 0.5 0.0;
            rel1.to_x: "knob";
            rel1.to_y: "base";
            rel2.to: "base";
         }
         description { state: "disabled_inverted" 0.0;
            inherit: "inverted" 0.0;
            color_class: "/fg/disabled/slider/bar";
         }
      }
      part { name: "efl.draggable.slider"; type: RECT;
         scale: 1;
         dragable.x: 1 1 0;
         dragable.y: 0 0 0;
         dragable.confine: "efl.bar";
         description { state: "default" 0.0;
            color: 0 0 0 0; // no cc
            min: 16 16;
            max: 16 16;
            fixed: 1 1;
            rel1.relative: 0.5 0.0;
            rel1.to_x: "efl.bar";
            rel2.relative: 0.5 1.0;
            rel2.to_x: "efl.bar";
         }
      }
      part { name: "knob"; nomouse;
         scale: 1;
         description { state: "default" 0.0;
            fixed: 1 1;
            rel.to: "efl.draggable.slider";
            image.normal: "i-radio";
            min: 16 16;
            max: 16 16;
            color_class: "/fg/normal/slider/knob";
         }
         description { state: "clicked" 0.0;
            inherit: "default" 0.0;
            color_class: "/fg/pressed/slider/knob";
         }
         description { state: "disabled" 0.0;
            inherit: "default" 0.0;
            color_class: "/fg/disabled/slider/knob";
         }
      }
      part { name: "event"; type: RECT;
         description { state: "default" 0.0;
            color: 0 0 0 0; // no cc
            visible: 0;
         }
         description { state: "disabled" 0.0;
            inherit: "default" 0.0;
            visible: 1;
         }
      }
   }
   programs {
      program { signal: "mouse,down,1"; source: "efl.draggable.slider";
         action:  STATE_SET "clicked" 0.0;
         target: "knob";
      }
      program { signal: "mouse,up,1"; source: "efl.draggable.slider";
         action:  STATE_SET "default" 0.0;
         target: "knob";
      }
      program { signal: "efl,state,inverted,on"; source: "efl";
         script {
            new m = get_int(slmode);
            m |= INVERT; set_int(slmode, m);
            eval_mode(m);
         }
      }
      program { signal: "efl,state,inverted,off"; source: "efl";
         script {
            new m = get_int(slmode);
            m &= ~INVERT; set_int(slmode, m);
            eval_mode(m);
         }
      }
      program { signal: "efl,state,disabled"; source: "efl";
         script {
            new m = get_int(slmode);
            m |= DISABLE; set_int(slmode, m);
            eval_mode(m);
         }
      }
      program { signal: "efl,state,enabled"; source: "efl";
         script {
            new m = get_int(slmode);
            m &= ~DISABLE; set_int(slmode, m);
            eval_mode(m);
         }
      }
   }
#undef INVERT
}

group { name: "efl/slider/vertical";
   data.item: "version" "123";
#define INVERT  16
   script {
      public slmode;
      public eval_mode(m) {
         new d = m & DISABLE;
         new i = m & INVERT;
         if (i) {
            if (!d) {
               set_state(PART:"base", "default", 0.0);
               set_state(PART:"glow", "inverted", 0.0);
            } else {
               set_state(PART:"base", "disabled", 0.0);
               set_state(PART:"glow", "disabled_inverted", 0.0);
            }
         } else {
            if (!d) {
               set_state(PART:"base", "default", 0.0);
               set_state(PART:"glow", "default", 0.0);
            } else {
               set_state(PART:"base", "disabled", 0.0);
               set_state(PART:"glow", "disabled", 0.0);
            }
         }
         if (!d) {
            set_state(PART:"event", "default", 0.0);
            set_state(PART:"knob", "default", 0.0);
         } else {
            set_state(PART:"event", "disabled", 0.0);
            set_state(PART:"knob", "disabled", 0.0);
         }
      }
   }
   parts {
      part { name: "efl.bar"; type: SWALLOW;
         scale: 1;
         description { state: "default" 0.0;
            min: 20 40;
            max: 20 99999;
            align: 0.5 1.0;
            rel1.offset: 4 4;
            rel2.offset: -5 -5;
            offscale;
         }
      }
      part { name: "base"; type: RECT; mouse_events: 0;
         scale: 1;
         description { state: "default" 0.0;
            rel.to: "efl.bar";
            color_class: "/bg/normal/slider/base";
            min: 4 8;
            max: 4 99999;
            fixed: 1 0;
         }
         description { state: "disabled" 0.0;
            inherit: "default" 0.0;
            color_class: "/bg/disabled/slider/base";
         }
      }
      part { name: "glow"; type: RECT; mouse_events: 0;
         description { state: "default" 0.0;
            color_class: "/fg/normal/slider/bar";
            rel1.to: "base";
            rel2.relative: 1.0 0.5;
            rel2.to_y: "knob";
            rel2.to_x: "base";
         }
         description { state: "disabled" 0.0;
            inherit: "default" 0.0;
            color_class: "/fg/disabled/slider/bar";
         }
         description { state: "inverted" 0.0;
            color_class: "/fg/disabled/slider/bar";
            rel1.relative: 0.0 0.5;
            rel1.to_y: "knob";
            rel1.to_x: "base";
            rel2.to: "base";
         }
         description { state: "disabled_inverted" 0.0;
            inherit: "inverted" 0.0;
            color_class: "/fg/disabled/slider/bar";
         }
      }
      part { name: "efl.draggable.slider"; type: RECT;
         scale: 1;
         dragable.x: 0 0 0;
         dragable.y: 1 1 0;
         dragable.confine: "efl.bar";
         description { state: "default" 0.0;
            color: 0 0 0 0; // no cc
            min: 16 16;
            max: 16 16;
            fixed: 1 1;
            rel1.relative: 0.0 0.5;
            rel1.to_y: "efl.bar";
            rel2.relative: 1.0 0.5;
            rel2.to_y: "efl.bar";
         }
      }
      part { name: "knob"; nomouse;
         scale: 1;
         description { state: "default" 0.0;
            fixed: 1 1;
            rel.to: "efl.draggable.slider";
            image.normal: "i-radio";
            min: 16 16;
            max: 16 16;
            color_class: "/fg/normal/slider/knob";
         }
         description { state: "clicked" 0.0;
            inherit: "default" 0.0;
            color_class: "/fg/pressed/slider/knob";
         }
         description { state: "disabled" 0.0;
            inherit: "default" 0.0;
            color_class: "/fg/disabled/slider/knob";
         }
      }
      part { name: "event"; type: RECT;
         description { state: "default" 0.0;
            color: 0 0 0 0; // no cc
            visible: 0;
         }
         description { state: "disabled" 0.0;
            inherit: "default" 0.0;
            visible: 1;
         }
      }
   }
   programs {
      program { signal: "mouse,down,1"; source: "efl.draggable.slider";
         action:  STATE_SET "clicked" 0.0;
         target: "knob";
      }
      program { signal: "mouse,up,1"; source: "efl.draggable.slider";
         action:  STATE_SET "default" 0.0;
         target: "knob";
      }
      program { signal: "efl,state,inverted,on"; source: "efl";
         script {
            new m = get_int(slmode);
            m |= INVERT; set_int(slmode, m);
            eval_mode(m);
         }
      }
      program { signal: "efl,state,inverted,off"; source: "efl";
         script {
            new m = get_int(slmode);
            m &= ~INVERT; set_int(slmode, m);
            eval_mode(m);
         }
      }
      program { signal: "efl,state,disabled"; source: "efl";
         script {
            new m = get_int(slmode);
            m |= DISABLE; set_int(slmode, m);
            eval_mode(m);
         }
      }
      program { signal: "efl,state,enabled"; source: "efl";
         script {
            new m = get_int(slmode);
            m &= ~DISABLE; set_int(slmode, m);
            eval_mode(m);
         }
      }
   }
#undef INVERT
}

//Range
group { name: "efl/slider_interval/horizontal";
   data.item: "version" "123";
   script {
      public slmode;
      public update_glow() {
         new Float:x1, Float:y1;
         new Float:x2, Float:y2;
         get_drag(PART:"efl.draggable.slider", x1, y1);
         get_drag(PART:"efl.draggable2.slider", x2, y2);
         if (x2 < x1)
           set_state(PART:"glow", "range_reverse", 0.0);
         else
           set_state(PART:"glow", "default", 0.0);
      }
      public eval_mode(m) {
         new d = m & DISABLE;
         if (d) {
            new Float:x1, Float:y1;
            new Float:x2, Float:y2;
            get_drag(PART:"efl.draggable.slider", x1, y1);
            get_drag(PART:"efl.draggable2.slider", x2, y2);
            set_state(PART:"base", "disabled", 0.0);
            if (x2 < x1)
              set_state(PART:"glow", "disabled_range_reverse", 0.0);
            else
              set_state(PART:"glow", "disabled_range", 0.0);
         }
         if (!d)
           set_state(PART:"event", "default", 0.0);
         else
           set_state(PART:"event", "disabled", 0.0);
      }
   }
   parts {
      part { name: "efl.bar"; type: SWALLOW;
         scale: 1;
         description { state: "default" 0.0;
            min: 40 20;
            max: 99999 20;
            align: 1.0 0.5;
            rel1.offset: 4 4;
            rel2.offset: -5 -5;
            offscale;
         }
      }
      part { name: "base"; type: RECT; mouse_events: 0;
         scale: 1;
         description { state: "default" 0.0;
            rel.to: "efl.bar";
            color_class: "/bg/normal/slider/base";
            min: 8 4;
            max: 99999 4;
            fixed: 0 1;
         }
         description { state: "disabled" 0.0;
            inherit: "default" 0.0;
            color_class: "/bg/disabled/slider/base";
         }
      }
      part { name: "glow"; type: RECT; mouse_events: 0;
         description { state: "default" 0.0;
            color_class: "/fg/normal/slider/bar";
            rel1.relative: 0.5 0.0;
            rel2.relative: 0.5 1.0;
            rel1.to_x: "knob";
            rel2.to_x: "knob2";
            rel1.to_y: "base";
            rel2.to_y: "base";
         }
         description { state: "disabled_range" 0.0;
            inherit: "default" 0.0;
            color_class: "/fg/disabled/slider/bar";
         }
         description { state: "range_reverse" 0.0;
            inherit: "default" 0.0;
            color_class: "/fg/normal/slider/bar";
            rel1.to_x: "knob2";
            rel2.to_x: "knob";
         }
         description { state: "disabled_range_reverse" 0.0;
            inherit: "range_reverse" 0.0;
            color_class: "/fg/disabled/slider/bar";
         }
      }
      part { name: "efl.draggable.slider"; type: RECT;
         scale: 1;
         dragable.x: 1 1 0;
         dragable.y: 0 0 0;
         dragable.confine: "efl.bar";
         description { state: "default" 0.0;
            color: 0 0 0 0; // no cc
            min: 16 16;
            max: 16 16;
            fixed: 1 1;
            rel1.relative: 0.5 0.0;
            rel1.to_x: "efl.bar";
            rel2.relative: 0.5 1.0;
            rel2.to_x: "efl.bar";
         }
      }
      part { name: "knob"; nomouse;
         scale: 1;
         description { state: "default" 0.0;
            fixed: 1 1;
            rel.to: "efl.draggable.slider";
            image.normal: "i-radio";
            min: 16 16;
            max: 16 16;
            color_class: "/fg/normal/slider/knob";
         }
         description { state: "clicked" 0.0;
            inherit: "default" 0.0;
            color_class: "/fg/pressed/slider/knob";
         }
         description { state: "disabled" 0.0;
            inherit: "default" 0.0;
            color_class: "/fg/disabled/slider/knob";
         }
      }
      part { name: "efl.draggable2.slider"; type: RECT;
         scale: 1;
         dragable.x: 1 1 0;
         dragable.y: 0 0 0;
         dragable.confine: "efl.bar";
         description { state: "default" 0.0;
            color: 0 0 0 0; // no cc
            min: 16 16;
            max: 16 16;
            fixed: 1 1;
            rel1.relative: 0.5 0.0;
            rel1.to_x: "efl.bar";
            rel2.relative: 0.5 1.0;
            rel2.to_x: "efl.bar";
         }
      }
      part { name: "knob2"; nomouse;
         scale: 1;
         description { state: "default" 0.0;
            fixed: 1 1;
            rel.to: "efl.draggable2.slider";
            image.normal: "i-radio";
            min: 16 16;
            max: 16 16;
            color_class: "/fg/normal/slider/knob";
         }
         description { state: "clicked" 0.0;
            inherit: "default" 0.0;
            color_class: "/fg/pressed/slider/knob";
         }
         description { state: "disabled" 0.0;
            inherit: "default" 0.0;
            color_class: "/fg/disabled/slider/knob";
         }
      }
      part { name: "event"; type: RECT;
         description { state: "default" 0.0;
            color: 0 0 0 0; // no cc
            visible: 0;
         }
         description { state: "disabled" 0.0;
            inherit: "default" 0.0;
            visible: 1;
         }
      }
   }
   programs {
      program { signal: "drag"; source: "efl.draggable*";
         script { update_glow(); }
      }
      program { signal: "mouse,down,1"; source: "efl.draggable.slider";
         action:  STATE_SET "clicked" 0.0;
         target: "knob";
      }
      program { signal: "mouse,up,1"; source: "efl.draggable.slider";
         action:  STATE_SET "default" 0.0;
         target: "knob";
      }
      program { signal: "mouse,down,1"; source: "efl.draggable2.slider";
         action:  STATE_SET "clicked" 0.0;
         target: "knob2";
      }
      program { signal: "mouse,up,1"; source: "efl.draggable2.slider";
         action:  STATE_SET "default" 0.0;
         target: "knob2";
      }
      program { signal: "efl,state,disabled"; source: "efl";
         script {
            new m = get_int(slmode);
            m |= DISABLE; set_int(slmode, m);
            eval_mode(m);
         }
      }
      program { signal: "efl,state,enabled"; source: "efl";
         script {
            new m = get_int(slmode);
            m &= ~DISABLE; set_int(slmode, m);
            eval_mode(m);
            update_glow();
         }
      }
   }
   }

group { name: "efl/slider_interval/vertical";
   data.item: "version" "123";
   script {
      public slmode;
      public update_glow() {
         new Float:x1, Float:y1;
         new Float:x2, Float:y2;
         get_drag(PART:"efl.draggable.slider", x1, y1);
         get_drag(PART:"efl.draggable2.slider", x2, y2);
         if (y2 < y1)
           set_state(PART:"glow", "range_reverse", 0.0);
         else
           set_state(PART:"glow", "default", 0.0);
      }
      public eval_mode(m) {
         new d = m & DISABLE;
         if (d) {
            new Float:x1, Float:y1;
            new Float:x2, Float:y2;
            get_drag(PART:"efl.draggable.slider", x1, y1);
            get_drag(PART:"efl.draggable2.slider", x2, y2);
            set_state(PART:"base", "disabled", 0.0);
            if (y2 < y1)
              set_state(PART:"glow", "disabled_range_reverse", 0.0);
            else
              set_state(PART:"glow", "disabled_range", 0.0);
         }
         if (!d)
           set_state(PART:"event", "default", 0.0);
         else
           set_state(PART:"event", "disabled", 0.0);
      }
   }
   parts {
      part { name: "efl.bar"; type: SWALLOW;
         scale: 1;
         description { state: "default" 0.0;
            min: 20 40;
            max: 20 99999;
            align: 0.5 1.0;
            rel1.offset: 4 4;
            rel2.offset: -5 -5;
            offscale;
         }
      }
      part { name: "base"; type: RECT; mouse_events: 0;
         scale: 1;
         description { state: "default" 0.0;
            rel.to: "efl.bar";
            color_class: "/bg/normal/slider/base";
            min: 4 8;
            max: 4 99999;
            fixed: 1 0;
         }
         description { state: "disabled" 0.0;
            inherit: "default" 0.0;
            color_class: "/bg/disabled/slider/base";
         }
      }
      part { name: "glow"; type: RECT; mouse_events: 0;
         description { state: "default" 0.0;
            color_class: "/fg/normal/slider/bar";
            rel1.relative: 0.0 0.5;
            rel2.relative: 1.0 0.5;
            rel1.to_x: "base";
            rel1.to_y: "knob";
            rel2.to_x: "base";
            rel2.to_y: "knob2";
         }
         description { state: "disabled_range" 0.0;
            inherit: "default" 0.0;
            color_class: "/fg/disabled/slider/bar";
         }
         description { state: "range_reverse" 0.0;
            inherit: "default" 0.0;
            color_class: "/fg/normal/slider/bar";
            rel1.to_y: "knob2";
            rel2.to_y: "knob";
         }
         description { state: "disabled_range_reverse" 0.0;
            inherit: "range_reverse" 0.0;
            color_class: "/fg/disabled/slider/bar";
         }
      }
      part { name: "efl.draggable.slider"; type: RECT;
         scale: 1;
         dragable.x: 0 0 0;
         dragable.y: 1 1 0;
         dragable.confine: "efl.bar";
         description { state: "default" 0.0;
            color: 0 0 0 0; // no cc
            min: 16 16;
            max: 16 16;
            fixed: 1 1;
            rel1.relative: 0.0 0.5;
            rel1.to_y: "efl.bar";
            rel2.relative: 1.0 0.5;
            rel2.to_y: "efl.bar";
         }
      }
      part { name: "knob"; nomouse;
         scale: 1;
         description { state: "default" 0.0;
            fixed: 1 1;
            rel.to: "efl.draggable.slider";
            image.normal: "i-radio";
            min: 16 16;
            max: 16 16;
            color_class: "/fg/normal/slider/knob";
         }
         description { state: "clicked" 0.0;
            inherit: "default" 0.0;
            color_class: "/fg/pressed/slider/knob";
         }
         description { state: "disabled" 0.0;
            inherit: "default" 0.0;
            color_class: "/fg/disabled/slider/knob";
         }
      }
      part { name: "efl.draggable2.slider"; type: RECT;
         scale: 1;
         dragable.x: 0 0 0;
         dragable.y: 1 1 0;
         dragable.confine: "efl.bar";
         description { state: "default" 0.0;
            color: 0 0 0 0; // no cc
            min: 16 16;
            max: 16 16;
            fixed: 1 1;
            rel1.relative: 0.0 0.5;
            rel1.to_y: "efl.bar";
            rel2.relative: 1.0 0.5;
            rel2.to_y: "efl.bar";
         }
      }
      part { name: "knob2"; nomouse;
         scale: 1;
         description { state: "default" 0.0;
            fixed: 1 1;
            rel.to: "efl.draggable2.slider";
            image.normal: "i-radio";
            min: 16 16;
            max: 16 16;
            color_class: "/fg/normal/slider/knob";
         }
         description { state: "clicked" 0.0;
            inherit: "default" 0.0;
            color_class: "/fg/pressed/slider/knob";
         }
         description { state: "disabled" 0.0;
            inherit: "default" 0.0;
            color_class: "/fg/disabled/slider/knob";
         }
      }
      part { name: "event"; type: RECT;
         description { state: "default" 0.0;
            color: 0 0 0 0; // no cc
            visible: 0;
         }
         description { state: "disabled" 0.0;
            inherit: "default" 0.0;
            visible: 1;
         }
      }
   }
   programs {
      program { signal: "drag"; source: "efl.draggable*";
         script { update_glow(); }
      }
      program { signal: "mouse,down,1"; source: "efl.draggable.slider";
         action:  STATE_SET "clicked" 0.0;
         target: "knob";
      }
      program { signal: "mouse,up,1"; source: "efl.draggable.slider";
         action:  STATE_SET "default" 0.0;
         target: "knob";
      }
      program { signal: "mouse,down,1"; source: "efl.draggable2.slider";
         action:  STATE_SET "clicked" 0.0;
         target: "knob2";
      }
      program { signal: "mouse,up,1"; source: "efl.draggable2.slider";
         action:  STATE_SET "default" 0.0;
         target: "knob2";
      }
      program { signal: "efl,state,disabled"; source: "efl";
         script {
            new m = get_int(slmode);
            m |= DISABLE; set_int(slmode, m);
            eval_mode(m);
         }
      }
      program { signal: "efl,state,enabled"; source: "efl";
         script {
            new m = get_int(slmode);
            m &= ~DISABLE; set_int(slmode, m);
            eval_mode(m);
            update_glow();
         }
      }
   }
}
